import request from '@/utils/request'

// 回款计划开始
// 获取回款计划列表
export function listRepaymentPlan(query) {
  return request({
    url: '/ord/ordrepaymentplan/list',
    method: 'get',
    params: query
  })
}

// 新增回款计划
export function setRepaymentPlan(data) {
  return request({
    url: '/ord/ordrepaymentplan/save',
    method: 'post',
    data
  })
}

//删除回款计划
export function delRepaymentPlan(ids) {
  return request({
    url: '/ord/ordrepaymentplan/delete/' + ids,
    method: 'post'
  })
}

//通过计划id获取回款计划详情
export function getRepaymentPlan(id) {
  return request({
    url: '/ord/ordrepaymentplan/get/' + id,
    method: 'get'
  })
}
//通过订单id获取回款计划详情
export function getRepaymentPlanOrderId(orderId) {
  return request({
    url: '/ord/ordrepaymentplan/getByOrderId/' + orderId,
    method: 'get'
  })
}
// 回款计划结束

// 回款管理开始
// 获取回款管理列表
export function listRepayment(query) {
  return request({
    url: '/ord/order/ordrepayment/list',
    method: 'get',
    params: query
  })
}
// 通过订单获取回款管理列表
export function listRepaymentRecord(query) {
  return request({
    url: '/ord/order/ordrepayment/getList',
    method: 'get',
    params: query
  })
}
// 新增回款管理
export function setRepayment(data) {
  return request({
    url: '/ord/order/ordrepayment/save',
    method: 'post',
    data
  })
}

//删除回款管理
export function delRepayment(ids) {
  return request({
    url: '/ord/order/ordrepayment/delete/' + ids,
    method: 'post'
  })
}

//通过id获取回款管理 回款记录
export function getRepayment(id) {
  return request({
    url: '/ord/order/ordrepayment/get/' + id,
    method: 'get'
  })
}

//通过id获取回款管理详情
export function getRepaymentDetail(orderId) {
  return request({
    url: '/ord/order/ordrepayment/detail/' + orderId,
    method: 'get'
  })
}
// 通过id获取回款管理详情
// export function getRepaymentDetail(query) {
//   return request({
//     url: '/ord/order/ordrepayment/detail/',
//     method: 'get',
//     params: query
//   })
// }

//通过订单id获取回款记录
export function getA8Repayment(ids) {
  return request({
    url: '/ord/order/ordrepayment/handleFromA8/' + ids,
    method: 'post'
  })
}
// 回款管理结束
